// [[ OnflowGenerator Entity UUID: 2f9ed31f35ec465194eb2801ca8fb0ec ]]
package com.itdct.onflow.system.dict.entity

import com.baomidou.mybatisplus.annotation.TableName
import com.itdct.onflow.core.annotation.Column
import com.itdct.onflow.core.annotation.ColumnRelateId
import com.itdct.onflow.core.annotation.TableDescription
import com.itdct.onflow.core.entity.BaseUserEntity

/**
 * @author Zhouwx
 * @date 2025/8/14 17:27:50
 * @version 1.0
 * @description
 */
@TableDescription("系统字典")
@TableName("sys_dict")
class SysDictEntity : BaseUserEntity() {
    @Column(comment = "字典码", nullable = false, defaultValue = "", length = 100, indexed = true, sort = 10, forSelect = true)
    var code = ""

    @Column(comment = "字典值", nullable = false, defaultValue = "", length = 100, indexed = true, sort = 20, forSelect = true)
    var name = ""

    @Column(comment = "字典码路径", nullable = false, defaultValue = "", unique = true, length = 500, sort = 30)
    var codePath = ""

    @ColumnRelateId(targetClass = SysDictEntity::class, targetFieldName = "name")
    @Column(comment = "父节点id", nullable = false, defaultValue = "0", sort = 40)
    var parentId = 0L

    @Column(comment = "排序", nullable = false, defaultValue = "0", sort = 60)
    var sort = 0

    @Column(comment = "字典说明", nullable = true, defaultValue = "", length = 500, sort = 100)
    var remark = ""
}